package com.yanxp.mybatis.factory;

import com.yanxp.mybatis.config.Configuration;
import com.yanxp.mybatis.session.SqlSession;
import com.yanxp.mybatis.session.SqlSessionImpl;

/**
 * 会话工厂：负责创建sqlsession会话信息
 *
 * @author yuanxp
 * @Date 2021/3/4 16:05
 */
public class SqlSessionFactory {

    private Configuration configuration;

    public SqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
    }

    public SqlSession openSession() {
        return new SqlSessionImpl(configuration);
    }

}
